export default () => {
  // @ts-ignore
  const roleAccess = sessionStorage.getItem('access')
    ? JSON.parse(sessionStorage.getItem('access'))
    : [];
  const access: any = {};
  if (roleAccess.length) {
    roleAccess.forEach((i: string) => {
      access[i] = true;
    });
  }
  // console.log('access.admin', access.admin);
  return {
    // ...access,
    // admin: access.admin || access.superAdmin
    // canSeeAdmin
    admin: roleAccess.includes('admin') || roleAccess.includes('superAdmin'),
    superAdmin: roleAccess.includes('superAdmin'),
  };
};
